<template>
  <s-layout class="set-wrap" title="个人简介" :bgStyle="{ color: '#f7f7f7' }">
    <s-empty v-if="state.list.length === 0 && !state.loading" text="暂无常见问题" icon="/static/collect-empty.png" />
    <!--  -->
    <view class="flex flex-col gap-2 p-4">
      <view class="">{{ state.list.title }}</view>
      <view>
        {{ state.list.content }}
      </view>
    </view>
  </s-layout>
</template>

<script setup>
  import sheep from '@/sheep';

  import { onLoad, onReachBottom, onPullDownRefresh } from '@dcloudio/uni-app';

  const state = ref({
    list: {},
    loading: true,
    options: {},
  });
  onLoad((options) => {
    state.value.options = options;
    articleShow(options);
  });
  onPullDownRefresh(() => {
    console.log('333==> ', 333);
    articleShow(state.value.options);
  });

  function articleShow(params) {
    let obj = {
      id: params.id,
    };
    console.log('obj==> ', obj);
    sheep.$api.yy.articleShow(obj).then((res) => {
      state.value.list = res.data;
    });
  }
</script>

<style lang="scss" scoped></style>
